package com.studyprojectbacked.entity.dto;

import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

@Data
public class RegisterAccount {
  private static final String EMAIL_REGEXP = "^[a-zA-Z0-9._%=-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$";
  private static final String USERNAME_REGEXP = "^[a-zA-Z0-9\u4e00-\u9fa5]+$";

  @Pattern(regexp = USERNAME_REGEXP)
  @Length(min = 6, max = 18)
  private String username;

  @Length(min = 6, max = 18)
  private String password;

  @Pattern(regexp = EMAIL_REGEXP)
  private String email;

  @Length(min = 6, max = 6)
  private String code;
}
